<#-- @ftlvariable name="instance" type="com.fable.sp.core.domain.WidgetInstance" -->
<#-- @ftlvariable name="switchable" type="java.lang.Boolean" -->
<#-- @ftlvariable name="content" type="com.fable.sp.core.domain.LayoutItemContent" -->
<input type="hidden" name="hasPreference" value="${hasPreference?string}">
<#if switchable>
<div class="panel panel-default">
    <div class="panel-body">
        <div class="form-group">
            <div class="col-sm-5 control-label form-control-static">是否可编辑</div>
            <div class="col-sm-7">
                <input class="bootstrap-switch" data-size="small" type="checkbox"
                       <#if content.mode=="edit">checked</#if> data-on-text="是" data-off-text="否"
                       data-content-id="${content.id}"/>
            </div>
        </div>
    </div>
</div>
</#if>
<form action="<@spring.url relativeUrl="/sp/saveInstance"/>" method="post">
    <input type="hidden" name="id" value="${instance.id}">
    <div class="panel panel-default">
        <div class="panel-heading">
            组件实例信息
            <button class="pull-right save-instance btn btn-xs btn-default" type="button" ajax-submit-reload="false">保存</button>
        </div>
        <div class="panel-body">
            <div class="form-group form-group-sm">
                <div class="col-sm-3 control-label">名称</div>
                <div class="col-sm-9">
                    <input class="form-control validate[required]" placeholder="输入名称" value="${instance.displayName}"
                           name="info" type="text">
                </div>
            </div>
        </div>
    </div>
</form>
<#assign formAction><@spring.url relativeUrl='/sp/saveContentStyle'/></#assign>
<@ui.styleEditor styleEntity=content formAction=formAction title="内容样式">
</@ui.styleEditor>